//
// Created by Administrator on 2022/7/7.
//
#include "Tree.cpp"
int find(Tree root){
    if(root!=NULL){
        while(root->leftChild!=NULL||root->rightChild!=NULL){
            while(root->leftChild!=NULL){
                root=root->leftChild;
            }
            if(root->rightChild!=NULL){
                root=root->rightChild;
            }
        }
    }
    return root->data;
}
int main(){
    Tree tree= CreateTreeByFile("Day-610-1.txt");
    printf("%d",find(tree));
}